
//
//  sooc.swift
//  BOSS-SOOC
//
//  Created by apple on 16/8/15.
//  Copyright © 2016年 Gcx. All rights reserved.
//

import UIKit

//屏幕比例

let SCALE_SCREEN  = SIZEWIDTH/414
//不需要等比缩放的控件
func SCALE(A:CGFloat) ->CGFloat {
    return A*0.383
    
}

//需要等比缩放的空间
func SCALE1080P(A:CGFloat) ->CGFloat {
    return A*0.383*SCALE_SCREEN
    
}

func FONE_MY(A:CGFloat)->UIFont{
    
    return UIFont.systemFontOfSize(A*0.383);
}



let SIZEWIDTH = UIScreen().bounds.width
let SIZEHEIGHT = UIScreen().bounds.height

/**
 *颜色
 */
let bgc = UIColor.init(red: 245/255.0, green: 245/255.0, blue: 245/255.0, alpha: 1)

let colordbdbdb = UIColor.init(red: 219/255.0, green: 219/255.0, blue: 219/255.0, alpha: 1)
let COLOR_333333 = UIColor.init(red: 51/255.0, green: 51/255.0, blue: 51/255.0, alpha: 1)
let COLOR_666666 = UIColor.init(red: 102/255.0, green: 102/255.0, blue: 102/255.0, alpha: 1)
let COLOR_999999 = UIColor.init(red: 153/255.0, green: 153/255.0, blue: 153/255.0, alpha: 1)
let COLOR_LINE_SYSTEM = UIColor.init(red: 200/255.0, green: 199/255.0, blue: 204/255.0, alpha: 1)
//坐标转化
func CGRECTMAKE2(rect:CGRect) ->CGRect{
    
//    return CGRectMake(rect.origin.x-rect.size.width, rect.origin.y, rect.size.width, rect.size.height)
    return CGRect.init(x: 10, y: 10, width: 10, height: 10);
    
}

/**
 swift工具类   包含了常用的工具
 */


//计算字符串长度
func sizeOfString(str:String,font:UIFont) ->CGFloat {
    
    let label = UILabel();
    label.font = font
    
    label.text = str
//    return label.sizeThatFits(CGSizeMake(0, 50)).width
    return 10;
}
